package com.manhanlou.service;

import com.manhanlou.dao.MultiTableDao;
import com.manhanlou.domain.Bill;
import com.manhanlou.domain.MultiTableBean;

import java.util.ArrayList;
import java.util.List;

/**
 * 多表查询业务
 *
 * @author wty
 * @date 2022/11/9 22:51
 */
public class MultiTableService {
    private MultiTableDao multiTableDao = new MultiTableDao();

    public List<MultiTableBean> queryMultiTable() {
        List<MultiTableBean> list = new ArrayList<>();
        String sqlStr = "SELECT a.id,NAME,menuId,price,nums,money,diningTableId,billDate,state FROM bill a,menu b WHERE a.menuId = b.id";

        list = multiTableDao.queryMulti(sqlStr, MultiTableBean.class);

        return list;
    }
}
